home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 050 / powertb.arc / GETPARM.INC < prev    next >
Encoding:
Text File  |  1985-02-23  |  728 b   |  27 lines

  1. { Turbo Pascal procedure to retrieve command line parameters }
  2. { Copywrite 1984 Micheal A. Covington }
  3.  
  4. type parmtype = string[127];
  5.  
  6. procedure getparm(var s:parmtype);
  7.  
  8.    { Returns first avalialbe parameter from Dos command
  9.      line and removes it so that the next parameter will
  10.      be returned on the next call.  If no more parameters
  11.      are available, a null string is returned. }
  12.  
  13. var  parms: parmtype absolute CSEG:$80;
  14.  
  15. begin
  16.    s := '';
  17.    { parm[1] exists even when the length is zero }
  18.    while (length(parms) > 0) and (parms[1] = ' ') do
  19.       delete(parms,1,1);
  20.    while (length(parms) > 0) and (parms[1] <> ' ') do begin
  21.       s := s + parms[1]; delete(parms,1,1)
  22.       end;
  23. end;
  24.  
  25.  
  26.  
  27.